import request from '@/utils/request'
import { ADMIN } from '@/config/baseUrl'

// 查询在线用户列表
export function list(query) {
  return request({
    url: ADMIN + '/monitor/online/list',
    method: 'get',
    params: query
  })
}

// 强退用户
export function forceLogout(tokenId) {
  return request({
    url: ADMIN + '/monitor/online/' + tokenId,
    method: 'delete'
  })
}
// 临时禁止登录 or 强制注销所有会话
export function logoutOther(userName) {
  return request({
    url: ADMIN + '/monitor/online/logoutOther',
    method: 'delete',
    params:{userName:userName}
  })
}

//  批量注销会话
export function logoutBatch(ids) {
  return request({
    url: ADMIN + '/monitor/online/logoutBatch',
    method: 'delete',
    params:{ids:ids}
  })
}
